'use strict'

module.exports = (app) => {
    const { STRING, INTEGER, DOUBLE, DATE, BOOLEAN } = app.Sequelize
    const House = app.model.define('house', {
        id: { type: INTEGER, primaryKey: true, autoIncrement: true },
        title: STRING,
        price: DOUBLE,
        location: STRING,
        province: STRING,
        city: STRING,
        area: DOUBLE, // 面积
        overview: STRING, // 概述id
        houseType: STRING, // 房子类型：一室
        rentType: STRING, // 租聘类型：整租
        bedroom: STRING, // 主卧
        ownerId: STRING, // 房东
        publishDate: DATE,
        valid: BOOLEAN, // 是否有效：下架
        floor: INTEGER,
        desc: STRING,
        matchingId: STRING,
    })

    return House
}
